Imports Gabbscript.Parser

Module Main

    Sub Main(ByVal args() As String)
        Dim fileName As String = ""

        'Initialize script
        Dim s As Script = New Script()

        'Register Module Functions
        AndrewFunctions.RegisterFunctions(s.funcList)
        BrendanFunctions.RegisterFunctions(s.funcList)

        'Check the amount of arguments
        If args.Length = 0 Then

            Console.WriteLine("Enter a filename to load :)")
            'Ask the user for a file to load
            fileName = Console.ReadLine()
        Else
            'Filename is first program parameter
            fileName = args(0)
        End If

        'Load the file
        s.LoadFile(fileName)

        'Parse the file
        s.ParseFile()

        'Run the code :)
        s.Run()
    End Sub

End Module
